const { MYSQL_CONFIG , MYSQL_ACCOUNT} = require("../config");

const Sequelize = require("sequelize");

const seq = new Sequelize(MYSQL_ACCOUNT.dataBaseName, MYSQL_ACCOUNT.user, MYSQL_ACCOUNT.password, MYSQL_CONFIG);

seq
  .authenticate()
  .then(() => {
    console.log("数据库连接成功");
  })
  .catch((err) => {
    console.error("数据库连接失败", err);
  });

module.exports = seq;
